<template>
  <div class="my_input">
      <input :type="type" :placeholder="placeholder" :value="modelValue" @input="$emit('update:modelValue',$event.target.value)" @blur="$emit('blur')">
      <span class="exte">
          <slot name="rule"></slot>
      </span>
      <span>
          <slot name="icon"></slot>
      </span>
  </div>
</template>

<script>
import { ref, reactive, toRefs } from "vue";
export default {
  props:{
    modelValue: [String,Number],
    placeholder: String,
    type:{
      type: String,
      default: 'text' // 如果父元素没有传入，指定类型，就使用默认值
    }
  },
  setup() {},
};
</script>
<style lang="scss" scoped>
.my_input{
  margin-top: 20px;
  height: 50px;
  display: flex;
  align-items: center;
  background: #F5F5F5;
  border-radius: 5px;
  width: 100%;
  padding: 0 10px;
  box-sizing: border-box;
  border: 1px solid transparent;
  .exte{
    font-size: 12px;
    color: red;
    margin-right: 10px;
  }
  input{
      flex: 1;
      border: none;
      background: transparent;
      font-size: 14px;
      min-width: 100px;
  }
}
</style>